#!/usr/bin/env python
# encoding: utf-8
"""
#-------------------------------------------------------------------#
#                   CONFIDENTIAL --- CUSTOM STUDIOS                 #     
#-------------------------------------------------------------------#
#                                                                   #
#                   @Project Name : Globallawonline                #
#                                                                   #
#                   @File Name    : getfilename.py                      #
#                                                                   #
#                   @Programmer   : 李建                            #
#                                                                   #  
#                   @Start Date   : 2021/6/22 10:34                 #
#                                                                   #
#                   @Last Update  : 2021/6/22 11:00                 #
#                                                                   #
#-------------------------------------------------------------------#
# Classes:获取当前目录下所有文件名及路径                                                          #
#                                                                   #
#-------------------------------------------------------------------#
"""
import os

if __name__ == '__main__':
    path = input("please input path:")
    root_path = os.path.join(path)
    for root, dirs, files in os.walk(root_path, topdown=False):
        file_root_path = root.lstrip(root_path)
        for file in files:
            if file.__contains__('.pdf'):
                file_path = os.path.join(file_root_path, file)
                with open("%s.txt"%file_root_path, 'a+', encoding='utf-8') as f:
                    f.write(file_path + '\n')

